/**
 * 二维数组 https://www.bilibili.com/video/BV1vs411n7TH?p=46
 * C 数组, c语言[n]在变量后面.  C数组 "越界" 可能不会报错, 但是结果不对
 */
#include <stdio.h>

#define SIZE 3

int main(void) {
    int c[2][SIZE];
    int d[2][3];  d[0][0] = 1;          //可以这样直接赋值!!!
    int e[][2] = {0};                   //等价于 int e[1][2], 将数组所有元素置为0
    int f[][3] = {0, 1, 2, 3};          //等价于 int f[2][3]
    int h[2][3] = {0};                  //将数组所有元素置为0
    int k[2][3] = {1};                  //k[0][0] = 1, 其余全=0
    int m[2][3] = {0,  1,  2, 10, 11};  //定义前5个的值, 后面全是0
    int n[2][3] = {{0,  1,  2},
                   {10, 11, 12}};

    //3维数组
    int o[2][2][2] = {{{0},  {1,  2}},
                      {{10}, {11, 12}}};
    int p[2][3][3] = {
            {{1,  11,  111},  {2,  22,  222},  {3,  33,  333}},
            {{21, 211, 2111}, {22, 222, 2222}, {23, 233, 2333}}};


    // e[0]是指针类型, 打印值↓
    int *g = e[0];
    for (int i = 0; i < 2; ++i) {//打印 g
        printf("%d ", g[i]);     //0 0
    }
}
